// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/workbench/api/ReportFormCenterApi'

import InfoClass from '@api/workbench/model/ReportFormCenterReq'
import DownClass from '@api/workbench/model/ReportFormCenterExportReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 信息 —————————————————————————————— //

  async getInfo(param, TIP = '查询信息') {
    const DTO = CORE.grpcDTO(InfoClass, param)
    const resp = await CORE.grpc(TIP, CLIENT, 'query', DTO)
    return resp
  },

  // —————————————————————————————— 下载 —————————————————————————————— //

  async download(downParam, TIP = '导出报表') {
    const DTO = CORE.grpcDTO(DownClass, downParam)
    await CORE.grpcDownload(TIP, CLIENT, 'exportExcel', DTO, null, downParam.fileName)
    return CORE.grpcOK(TIP)
  },
}
